<template>
    <div class="category">
        <h3>{{title}}</h3>
        <!-- 定义一个插槽(挖个坑,等着组件的使用者进行填充) -->
        <slot :games="games" msg="你好">默认内容</slot>
    </div>
</template>

<script>
export default {
    name: 'category',
    props: ['title'],
    data () {
      return {
        games: ['红警', 'CF', '劲舞团', '超级玛丽'],
      }
    }   
}
</script>

<style>
    .category {
        background: skyblue;
        width: 200px;
        height: 300px;
    }
    h3 {
        text-align: center;
        background: orange;
    }
</style>